"""
封装shell命令,windows的cmd命令
"""
import subprocess
class Shell:
    @staticmethod
    def execute(cmd):
        output, error = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()
        out_msg = output.decode("gbk")
        return out_msg

if __name__ == '__main__':
    print(Shell.execute("dir"))